********************************************************************************************************************************
***   Replication file for:                                                                                                  ***
***   Berbee, P., Braun, S. T. and Franke, R. (2024). Reversing Fortunes of German Regions, 1926-2019. JOEG				     ***
***   							                                                                                             ***
***   SCRIPT: 	3_industrialization_and_development.do				   														 ***	
***   PURPOSE: 	Generates the figures and tables in Section 3 ("Early industrialization and economic development, 			 ***
***				1926-2019") and the associated Appendix A.2.																 ***
***	  Tables:	1, A-3, A-4																									 ***
***	  Figures:	5																											 ***
********************************************************************************************************************************


* Preamble (unnecessary when executing run.do)
run "$reversing/scripts/programs/_config.do"

************
* Code begins
************

use "$reversing/processed/workingdataset.dta", clear



************
*** Table 1: Early industrialization and regional economic development, 1926-2019

** Create variables for percentile ranks for 1926, 1957, 2019

gen help = rank_perc if year == 1926
bysort labor_market_id: egen rank_perc_1926 = mean(help)
drop help

gen help = rank_perc if year == 1957
bysort labor_market_id: egen rank_perc_1957 = mean(help)
drop help

gen help = rank_perc if year == 2019
bysort labor_market_id: egen rank_perc_2019 = mean(help)
drop help

** Choose covariates
local covariates log_land_access1 town_1700_perarea

** Change in percentile ranks: 1926-2019 (Column 1) and 1957-2019 (Column 2)
foreach year in 26 57 {
* OLS (clustered errors)
eststo ols_change`year'19_cluster: reg change_perc_`year'19  empshare_ind_1882_std `covariates' if year == 2019, cluster(rb_id)

* OLS (Conley errors)
eststo ols_change`year'19_conley: acreg change_perc_`year'19  empshare_ind_1882_std `covariates' if year == 2019, latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100)

* Reduced form (clustered errors)
eststo redform_change`year'19_cluster: reg change_perc_`year'19 log_coal_access1 `covariates' if year == 2019, cluster(rb_id)

* Reduced form (Conley errors)
eststo redform_change`year'19_conley: acreg change_perc_`year'19 log_coal_access1 `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100)

* 2SLS (clustered errors)
eststo twosls_change`year'19_cluster: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo twosls_change`year'19_conley: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}


** Ranking of GDP per capita 1926 (Column 3), 1957 (Column 4), and 2019 (Column 5)

foreach year in 1926 1957 2019 {

* OLS (clustered errors)
eststo ols_`year'_cluster: reg rank_perc empshare_ind_1882_std `covariates' if year == `year', cluster(rb_id)

* OLS (Conley errors)
eststo ols_`year'_conley: acreg rank_perc empshare_ind_1882_std `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100)

* Reduced form (clustered errors)
eststo redform_`year'_cluster: reg rank_perc log_coal_access1 `covariates' if year == `year', cluster(rb_id)

* Reduced form (Conley errors)
eststo redform_`year'_conley: acreg rank_perc log_coal_access1 `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100)

* 2SLS (clustered errors)
eststo twosls_`year'_cluster: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', first cluster(rb_id)

* 2SLS (Conley errors)
eststo twosls_`year'_conley: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

*** OLS table
esttab ols_change2619_conley ols_change5719_conley ols_1926_conley ols_1957_conley ols_2019_conley using"$reversing/results/tables/tab1_panelA.tex", keep (empshare_ind_1882_std) coeflabels(empshare_ind_1882_std "Employment share industry 1882") cells(b(star fmt(2)) se(fmt(2) par("(" ")"))) nomtitles nonum noobs collabel(none)  star(* 0.10 ** 0.05 *** 0.01) plain fragment booktabs replace 

esttab ols_change2619_cluster ols_change5719_cluster ols_1926_cluster ols_1957_cluster ols_2019_cluster using"$reversing/results/tables/tab1_panelA.tex", keep(empshare_ind_1882_std) coeflabels(empshare_ind_1882_std " ") cells(se(fmt(2) par("[" "]")))  nomtitles nonum noobs collabel(none)  plain fragment booktabs append

*** Reduced form table
esttab redform_change2619_conley redform_change5719_conley redform_1926_conley redform_1957_conley redform_2019_conley using"$reversing/results/tables/tab1_panelC.tex", keep (log_coal_access1) coeflabels(log_coal_access1 "Log access to coalfields") cells(b(star fmt(2)) se(fmt(2) par("(" ")"))) nomtitles nonum noobs collabel(none)  star(* 0.10 ** 0.05 *** 0.01) plain fragment booktabs replace

esttab redform_change2619_cluster redform_change5719_cluster redform_1926_cluster redform_1957_cluster redform_2019_cluster using"$reversing/results/tables/tab1_panelC.tex", keep(log_coal_access1) coeflabels(log_coal_access1 " ") cells(se(fmt(2) par("[" "]")))  nomtitles nonum noobs collabel(none)  plain fragment booktabs append

*** 2SLS Table
esttab twosls_change2619_conley twosls_change5719_conley twosls_1926_conley twosls_1957_conley twosls_2019_conley using"$reversing/results/tables/tab1_panelB.tex", keep (empshare_ind_1882_std) coeflabels(empshare_ind_1882_std "Employment share industry 1882") cells(b(star fmt(2)) se(fmt(2) par("(" ")"))) nomtitles nonum noobs collabel(none)  star(* 0.10 ** 0.05 *** 0.01) plain fragment booktabs replace

esttab twosls_change2619_cluster twosls_change5719_cluster twosls_1926_cluster twosls_1957_cluster twosls_2019_cluster using"$reversing/results/tables/tab1_panelB.tex", keep(empshare_ind_1882_std) coeflabels(empshare_ind_1882_std " ") cells(se(fmt(2) par("[" "]")))  nomtitles nonum noobs collabel(none) plain fragment booktabs append


************
*** Table A-3: Robustness checks of 2SLS estimates: Additional controls

************
*** A. Baseline specification

local covariates log_land_access1 town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelA.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Baseline specification") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelA.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

************
*** B. Contemporaneous shocks (spatially asyymetric)

************
*** B1. Division and unfication 

** B1a. Distance to inner-German border (logs)

local covariates log_land_access1 town_1700_perarea log_distGGB

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding distance to inner-German border (logs)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B1b. Lost market access 1945

local covariates log_land_access1 town_1700_perarea market_access_lost_1945

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}



esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding market access lost in 1945") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



** B1c. Distance to eastern border (logs)

local covariates log_land_access1 town_1700_perarea log_dist_Eborder 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}



esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding distances to eastern border (logs)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



** B1d. Redevelopment areas

local covariates log_land_access1 town_1700_perarea redevelopment_area

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding dummy for redevelopment areas") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB1.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



************
*** B2. Immigration

** B2a. Expellees 1950

local covariates log_land_access1 town_1700_perarea expellee_share_1950

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding expellee share in 1950") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B2b. GDR refugees 1961

local covariates log_land_access1 town_1700_perarea popshare_gdr_1961

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding share of GDR refugees in 1961") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append





** B2c. Guest workers, share foreigners 1970

local covariates log_land_access1 town_1700_perarea popshare_foreign_1970

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)

* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding share of foreigners in 1970") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



** B2d. Guest workers, share foreigners 1987

local covariates log_land_access1 town_1700_perarea popshare_foreign_1987

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding share of foreigners in 1987") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B2e. Refugee share 2016

local covariates log_land_access1 town_1700_perarea refugee_share_2016

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding share of refugees in 2016") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB2.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


************
*** B3. War damages

** B3a. Rubble per capita

local covariates log_land_access1 town_1700_perarea rubble_per_capita_1946

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB3.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding rubble per capita in 1946") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB3.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B3b. Damaged flats

local covariates log_land_access1 town_1700_perarea share_damaged_flats_1950

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB3.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding share of housing stock damaged in WWII") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB3.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


************
*** B4. European integration

** B4a. Distance to western border

local covariates log_land_access1 town_1700_perarea log_dist_Wborder

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

} 

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB4.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding distance to western border (logs)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB4.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B4b. Distance to Schengen area, 2008

local covariates log_land_access1 town_1700_perarea log_dist_schengen_2008 
*log_dist_schengen_2008

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

} 

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelB4.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding distance to Schengen area border 2008 (logs)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelB4.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



********************************************************************************

*** C. Geographic controls

** C1. Location at coast

local covariates log_land_access1 town_1700_perarea bordercoast 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding location at coast (0/1)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C2. Soil quality

local covariates log_land_access1 town_1700_perarea soil_quality 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding soil quality") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C3. Distance to coast and rivers

local covariates log_land_access1 town_1700_perarea log_dist_coast log_dist_river

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding distance to coast and rivers") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C3. Remoteness within Germany

local covariates log_land_access1 town_1700_perarea remote_KS2014

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding remoteness within Germany") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append




** C4. Sunshine hours

local covariates log_land_access1 town_1700_perarea sun9120

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding mean sunshine hours") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C5. All of the above

local covariates log_land_access1 town_1700_perarea bordercoast soil_quality log_dist_coast log_dist_river remote_KS2014 sun9120

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding all of the above") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


********************************************************************************

*** D. State fixed effects

tab state_id, gen(d_state_)
tab state_1834_id, gen(d_state_1834_)


** D1. Adding federal state fixed effects

local covariates log_land_access1 town_1700_perarea d_state_1 - d_state_8

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) partial(d_state_1 - d_state_8)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) partial(d_state_1 - d_state_8)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding federal state FE") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** D2. Adding federal state fixed effects and geography controls

local covariates log_land_access1 town_1700_perarea bordercoast soil_quality log_dist_coast log_dist_river remote_KS2014 sun9120 d_state_1 - d_state_8

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) partial(d_state_1 - d_state_8)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) partial(d_state_1 - d_state_8)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding geography controls \& federal state FE") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** D3. Adding 1834 state fixed effects

local covariates log_land_access1 town_1700_perarea d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) partial(d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) partial(d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding 1834 state FE") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** D4. Adding 1834 state fixed effects and geography controls

local covariates log_land_access1 town_1700_perarea bordercoast soil_quality log_dist_coast log_dist_river remote_KS2014 sun9120 d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) partial(d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) partial(d_state_1834_1 d_state_1834_2 d_state_1834_3 d_state_1834_4 d_state_1834_5 d_state_1834_6 d_state_1834_7)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}


esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding geography controls \& 1834 state FE") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


*** D5. Dummy for 1834 Zollverein membership

local covariates log_land_access1 town_1700_perarea zollverein_1834 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}


esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding indicator for 1834 Zollverein members") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA3_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append






************
*** Table A-4: Robustness checks of 2SLS estimates: Other checks and specifications
*** Note: Panel E for the district level regression is in a separate file
*** (3_industrialization_and_development_rb)

********************************************************************************
*** B. Explanatory variable

** B1. Occupational employment share in 1895

local covariates log_land_access1 town_1700_perarea 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1895_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1895_std=log_coal_access1) `covariates' if year == 2019, latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1895_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1895_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1895_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1895_std  "Employment share industry 1895") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1895_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1895_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** B2. Occupational employment share in 1907

local covariates log_land_access1 town_1700_perarea 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1907_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1907_std=log_coal_access1) `covariates' if year == 2019, latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1907_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1907_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1907_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1907_std  "Employment share industry 1907") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1907_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1907_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append



** B3. Adding tertiary employment share in 1882

local covariates log_land_access1 town_1700_perarea empshare_tert_1882_std

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id) 

* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Adding tertiary employment share in 1882") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelB.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append





********************************************************************************
*** C. Alternative specifications of the instrument

** C1. Based on Bairoch (1990)

local covariates log_land_access1_bai town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_bai) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_bai) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1_bai) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1_bai) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Based on Bairoch (1990)") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C2. Squared transport costs

local covariates log_land_access2_dau town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access2_dau) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access2_dau) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access2_dau) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access2_dau) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Squared transport costs") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C3. Only larger river

local covariates log_land_access1_lrivers_dau town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_lrivers_dau) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_lrivers_dau) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1_lrivers_dau) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1_lrivers_dau) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Only larger river") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C4. Carboniferous strata, Daudin

local covariates log_land_access1 town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_carb_access1_dau) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_carb_access1_dau) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_carb_access1_dau) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_carb_access1_dau) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Log access to carboniferous strata, Daudin ") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

** C5. Carboniferous strata, Bairoch

local covariates log_land_access1_bai town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_carb_access1_bai) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_carb_access1_bai) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_carb_access1_bai) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_carb_access1_bai) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Log access to carboniferous strata, Bairoch ") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


** C6. Based on coal fields in 1967

local covariates log_land_access1 town_1700_perarea

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_dau_PWA2) `covariates' if year == 2019, first cluster(rb_id) 

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1_dau_PWA2) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1_dau_PWA2) `covariates' if year == `year', cluster(rb_id) 


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1_dau_PWA2) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Accounting for coal fields in 1967") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelC.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append




********************************************************************************
*** D. Miscellaneous

*** D1. Without Ruhrgebiet

local covariates log_land_access1 town_1700_perarea 

preserve 

drop if ruhrgebiet == 1

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Without Ruhr area") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) replace

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

restore


*** D2. Weighted by 1882 population

local covariates log_land_access1 town_1700_perarea 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019 [aweight = pop_total_1882], first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_perc_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019 [pweight = pop_total_1882],  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year' [aweight = pop_total_1882], cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg rank_perc (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year' [pweight = pop_total_1882],  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Weighted by 1882 population") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append


*** D3. Dependent variable in levels

gen log_income = log_realpcGDP
replace log_income = log_realpcturnover if year == 1926

gen help = log_income if year == 1926
bysort labor_market_id: egen log_income_1926 = mean(help)
drop help

gen help = log_income if year == 1957
bysort labor_market_id: egen log_income_1957 = mean(help)
drop help

gen help = log_income if year == 2019
bysort labor_market_id: egen log_income_2019 = mean(help)
drop help

gen change_log_income_2619 = log_income_2019 - log_income_1926 
gen change_log_income_5719 = log_income_2019 - log_income_1957 

local covariates log_land_access1 town_1700_perarea 

** Change in percentile rank 1926-2019
foreach year in 26 57 {

* 2SLS (clustered errors)
eststo baseline_`year'19_cl: ivreg2 change_log_income_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019, first cluster(rb_id)

* 2SLS (Conley errors)
eststo baseline_`year'19_co: acreg change_log_income_`year'19 (empshare_ind_1882_std=log_coal_access1) `covariates' if year == 2019,  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
}

** Percentile rank 1926, 1957, 2019
foreach year in 1926 1957 2019{

* 2SLS (clustered errors) 
qui eststo baseline_`year'_cl: ivreg2 log_income (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year', cluster(rb_id)


* 2SLS (Conley errors)
qui eststo baseline_`year'_co: acreg log_income (empshare_ind_1882_std=log_coal_access1) `covariates' if year == `year',  latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 

}

esttab baseline_2619_co baseline_5719_co baseline_1926_co baseline_1957_co baseline_2019_co using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  "Log income as dependent variable") se(2) b(2) parentheses nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

esttab baseline_2619_cl baseline_5719_cl baseline_1926_cl baseline_1957_cl baseline_2019_cl using"$reversing/results/tables/tabA4_panelD.tex", keep (empshare_ind_1882_std) star(* 0.10 ** 0.05 *** 0.01) coeflabels(empshare_ind_1882_std  " ") cells(se(fmt(2) par("[" "]"))) nonotes noobs nodepvars fragment plain nomtitles nonum collabels(none) append

********************************************************************************



***************
*** Figure 5: Impact of early industrialization on the per capita income rank, 1926-2019

** Covariates
local covariates log_land_access1 town_1700_perarea

local years "1926 1935 1950 1957 1961 1970 1980 1992 2000 2010 2019"
matrix C90 = J(3,11,.)
matrix C95 = J(3,11,.)
local j = 1
foreach year in `years' {
		acreg rank_perc (empshare_ind_1882_std = log_coal_access1) `covariates' if year == `year', latitude(latitude) longitude(longitude) spatial bartlett distcutoff(100) 
		lincom empshare_ind_1882_std, level(90)
		matrix C90[1,`j']= r(estimate) \ r(lb) \ r(ub)
		lincom empshare_ind_1882_std, level(95)
		matrix C95[1,`j']= r(estimate) \ r(lb) \ r(ub)
		local ++j
}


local colnames
foreach year in `years' {
    local colnames `colnames' `year'
}
matrix colnames C90 = `colnames'
matrix list C90

matrix colnames C95 = `colnames'
matrix list C95

coefplot (matrix(C95), ci((C95[2] C95[3])) mcolor(black) ciopts(lpattern(solid) lcolor(black) msize(medlarge) recast(rcap))) (matrix(C90), ci((C90[2] C90[3])) mcolor(black) ciopts(lpattern(solid) lcolor(gray) lwidth(medium) mcolor(gray) msize(medlarge) recast(rcap))), xtitle("Year") yline(0, lcolor(black)) vertical graphregion(color(white)) at(_coef) xlabel(1930(10)2020, nogrid) ytitle("Percentile ranks") ylabel(-30(10)25, nogrid) legend(off)

graph export "$reversing/results/figures/fig5.eps", replace

*** EOF



